export function animate(obj, target, callback) {
    if (!obj) return
    clearInterval(obj.timer);
    obj.timer = setInterval(function () {
        var step = (target - obj.offsetTop) / 5;
        step = step > 0 ? Math.ceil(step) : Math.floor(step);
        if (obj.offsetTop == target) {
            clearInterval(obj.timer);
            callback && callback(); // 逻辑且短路
        } else {
            obj.style.top = obj.offsetTop + step + "px";
        }
    }, 30);
}